type int = number;
//class HTMLUtil

    export  class HTMLUtil
    {
       

        public static replaceHtmlTag(arg1: string): string
        {
            arg1 = arg1.replace(HTMLUtil.replaceTagLeft, "&lt;");
            arg1 = arg1.replace(HTMLUtil.replaceTagRight, "&gt;");
            return arg1;
        }

        public static addColor(arg1: string, arg2: string, arg3: string="", arg4: int=0): string
        {
            var loc1="<font color=\'" + arg2 + "\'";
            if (arg3 != "") 
            {
                loc1 = loc1 + (" face=\'" + arg3 + "\'");
            }
            if (arg4 > 0) 
            {
                loc1 = loc1 + (" size=\'" + arg4 + "\'");
            }
            return loc1 = loc1 + (">" + arg1 + "</font>");
        }

        public static addLink(arg1: string, arg2: string): string
        {
            return "<font color=\'" + arg2 + "\'><a href=\'event: 0\'><u>" + arg1 + "</u><a></font>";
        }

        public static removeHtml(arg1: string): string
        {
            if (arg1) 
            {
                return arg1.replace(HTMLUtil.delHtmlreg, "");
            }
            return "";
        }

        public static getHtmlByComp(arg1: string): string
        {
            return arg1.replace(new RegExp("\\[", "g"), "<").replace(new RegExp("\\]", "g"), ">");
        }

        private static /* var */delHtmlreg: RegExp;

        private static /* var */replaceTagLeft: RegExp;

        private static /* var */replaceTagRight: RegExp;
    }

            HTMLUtil.delHtmlreg = new RegExp("</?[^<>]+>", "gmi");
            HTMLUtil.replaceTagLeft = new RegExp("<", "g");
            HTMLUtil.replaceTagRight = new RegExp(">", "g");
        